import { useAxios } from '@/hooks/web/useAxios'
import { ReportMonthVO,ReportMonthPageReqVO,ReportMonthExcelReqVO } from './types'

const request = useAxios()

// 查询月报列表
export const getReportMonthPageApi = async (params: ReportMonthPageReqVO) => {
    return await request.get({ url: '/water/report-month/page', params })
}

// 查询月报详情
export const getReportMonthApi = async (id: number) => {
    return await request.get({ url: '/water/report-month/get?id=' + id })
}

// 新增月报
export const createReportMonthApi = async (data: ReportMonthVO) => {
    return await request.post({ url: '/water/report-month/create', data })
}

// 修改月报
export const updateReportMonthApi = async (data: ReportMonthVO) => {
    return await request.put({ url: '/water/report-month/update', data })
}

// 删除月报
export const deleteReportMonthApi = async (id: number) => {
    return await request.delete({ url: '/water/report-month/delete?id=' + id })
}

// 导出月报 Excel
export const exportReportMonthApi = async (params: ReportMonthExcelReqVO) => {
    return await request.download({ url: '/water/report-month/export-excel', params })
}
